package com.example.controller.student;

import com.example.common.Result;
import com.example.entity.DTO.StudentCourseDetailDTO;
import com.example.service.student.ExamService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class ExamController {
    @Resource
    private ExamService examService;

    /**
     * 根据学生id获取学生成绩
     */
    @GetMapping("/selectAllExam/{studentId}")
    public Result selectAllExam(@PathVariable Integer studentId) {
        List<StudentCourseDetailDTO> studentCourseDetailDTOS = examService.selectAllExam(studentId);
        return Result.success(studentCourseDetailDTOS);
    }
}